﻿using Core;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class CanBo_PageTrichLocThongTin : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    public bool ShowHoTen { get; set; }
    public bool ShowNgaySinh { get; set; }
    public bool ShowLoaiCanBo { get; set; }
    public bool ShowDonVi { get; set; }
    public bool ShowLaDangVien { get; set; }
    protected void btnTim_ServerClick(object sender, EventArgs e)
    {
        string s = "";
        for (int i = 0; i < cblTrichLoc.Items.Count; i++)
        {
            if (cblTrichLoc.Items[i].Selected)
            {
                if (cblTrichLoc.Items[i].Value == "HoTenCanBo")
                {
                    ShowHoTen = true;
                }
                if (cblTrichLoc.Items[i].Value == "NgaySinh")
                {
                    ShowNgaySinh = true;
                }
                if (cblTrichLoc.Items[i].Value == "LoaiCanBo")
                {
                    ShowLoaiCanBo = true;
                }
                if (cblTrichLoc.Items[i].Value == "DonVi")
                {
                    ShowDonVi = true;
                } if (cblTrichLoc.Items[i].Value == "LaDangVien")
                {
                    ShowLaDangVien = true;
                }
                s += cblTrichLoc.Items[i].Value;
            }
        }
       
        BinData();
    }
    void BinData()
    {
        int total = 0;
        int pageSize = PagingControl1.PageSize;

        int pageNum = 1;
        if (Request.QueryString[PagingControl1.QueryStringKey] != null)
        {
            pageNum = int.Parse(Server.HtmlEncode(Request.QueryString[PagingControl1.QueryStringKey]));
        }
        else pageNum = 1;

        rptData.DataSource = CanBo.Paging(pageSize, pageNum, out total);

        rptData.DataBind();

        PagingControl1.TotalRecord = total;
        PagingControl1.CurrentPage = pageNum;
        PagingControl1.PageSize = pageSize;


    }
}